package com.mec.beans.y2012.coreservlet;

public class BidInfo {

	private String itemName = "";
	private String itemId = "";
	private String bidderName = "";
	private String emailAddress = "";
	private Double bidPrice = 0.0;
	private boolean autoIncrement = false;
	
	public boolean isComplete(){
		return (hasValue(getItemId()) &&
				hasValue(getItemName()) &&
				hasValue(getBidderName()) &&
				hasValue(getEmailAddress()) &&
				(getBidPrice() > 0)
				);
	}
	
	public boolean isPartlyComplete(){
		boolean flag = (
				hasValue(getItemId()) ||
				hasValue(getItemName()) ||
				hasValue(getBidderName()) ||
				hasValue(getEmailAddress())||
				(getBidPrice() > 0) ||
				isAutoIncrement()
				);
		
		return flag;
	}

	public String getItemName() {
		return itemName;
	}

	private boolean hasValue(String value){
		return !(null == value || value.isEmpty());
	}
	public void setItemName(String itemName) {
		this.itemName = itemName;
	}

	public String getBidderName() {
		return bidderName;
	}

	public String getItemId() {
		return itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	public void setBidderName(String bidderName) {
		this.bidderName = bidderName;
	}

	public String getEmailAddress() {
		return emailAddress;
	}

	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}

	public Double getBidPrice() {
		return bidPrice;
	}

	public void setBidPrice(Double bidPrice) {
		this.bidPrice = bidPrice;
	}

	public boolean isAutoIncrement() {
		return autoIncrement;
	}

	public void setAutoIncrement(boolean autoIncrement) {
		this.autoIncrement = autoIncrement;
	}
	
	
}
